{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

module Generics.MultiRec.Languages.Java where

import Generics.MultiRec
import Generics.MultiRec.TH.Alt

import Language.Java.Parser.Parser
import Language.Java.Parser.Lexer
import Language.Java.Parser.AST

data JAVA :: (* -> *) where
  TheAlexPosn :: JAVA (AlexPosn)
  TheSourceSpan :: JAVA (SourceSpan)
  TheProgram :: JAVA (Program)
  TheClassDeclList :: JAVA (ClassDeclList)
  TheClassDecl :: JAVA (ClassDecl)
  TheClassMemberDecl :: JAVA (ClassMemberDecl)
  TheClassMemberList :: JAVA (ClassMemberList)
  TheConstructorDecl :: JAVA (ConstructorDecl)
  TheMethodDecl :: JAVA (MethodDecl)
  TheFormalList :: JAVA (FormalList)
  TheType :: JAVA (Type)
  TheStatement :: JAVA (Statement)
  TheStatementList :: JAVA (StatementList)
  TheExp :: JAVA (Exp)
  TheIdent :: JAVA (Ident)
  TheInteger_Literal :: JAVA (Integer_Literal)
  TheExpList :: JAVA (ExpList)
  TheExpRest :: JAVA (ExpRest)
  TheQualifiedIdent :: JAVA (QualifiedIdent)
  TheImportDecl :: JAVA (ImportDecl)
  TheImportDeclList :: JAVA (ImportDeclList)
  ThePackageDecl :: JAVA (PackageDecl)
  TheModifier :: JAVA (Modifier)
  TheModifiers :: JAVA (Modifiers)
  TheVarDecl :: JAVA (VarDecl)
  TheForParam :: JAVA (ForParam)

instance Show (JAVA AlexPosn) where
  show = const "TheAlexPosn"

instance Show (JAVA SourceSpan) where
  show = const "TheSourceSpan"

instance Show (JAVA Program) where
  show = const "TheProgram"

instance Show (JAVA ClassDeclList) where
  show = const "TheClassDeclList"

instance Show (JAVA ClassMemberDecl) where
  show = const "TheClassMemberDecl"

instance Show (JAVA ClassDecl) where
  show = const "TheClassDecl"

instance Show (JAVA ClassMemberList) where
  show = const "TheClassMemberList"

instance Show (JAVA ConstructorDecl) where
  show = const "TheConstructorDecl"

instance Show (JAVA MethodDecl) where
  show = const "TheMethodDecl"

instance Show (JAVA FormalList) where
  show = const "TheFormalList"

instance Show (JAVA Type) where
  show = const "TheType"

instance Show (JAVA Statement) where
  show = const "TheStatement"

instance Show (JAVA StatementList) where
  show = const "TheStatementList"

instance Show (JAVA Exp) where
  show = const "TheExp"

instance Show (JAVA Ident) where
  show = const "TheIdent"

instance Show (JAVA Integer_Literal) where
  show = const "TheInteger_Literal"

instance Show (JAVA ExpList) where
  show = const "TheExpList"

instance Show (JAVA ExpRest) where
  show = const "TheExpRest"

instance Show (JAVA QualifiedIdent) where
  show = const "TheQualifiedIdent"

instance Show (JAVA ImportDecl) where
  show = const "TheImportDecl"

instance Show (JAVA ImportDeclList) where
  show = const "TheImportDeclList"

instance Show (JAVA PackageDecl) where
  show = const "ThePackageDecl"

instance Show (JAVA Modifier) where
  show = const "TheModifier"

instance Show (JAVA Modifiers) where
  show = const "TheModifiers"

instance Show (JAVA VarDecl) where
  show = const "TheVarDecl"

instance Show (JAVA ForParam) where
  show = const "TheForParam"



$(deriveEverything
  (DerivOptions 
   [ ( [t| SourceSpan |] ,"TheSourceSpan")
   , ( [t| AlexPosn |] ,"TheAlexPosn")
   , ( [t| Program |] ,"TheProgram")
   , ( [t| ClassDeclList |] ,"TheClassDeclList")
   , ( [t| ClassDecl |] ,"TheClassDecl")
   , ( [t| ClassMemberDecl |] ,"TheClassMemberDecl")
   , ( [t| ClassMemberList |] ,"TheClassMemberList")
   , ( [t| ConstructorDecl |] ,"TheConstructorDecl")
   , ( [t| MethodDecl |] ,"TheMethodDecl")
   , ( [t| FormalList |] ,"TheFormalList")
   , ( [t| Type |] ,"TheType")
   , ( [t| Statement |] ,"TheStatement")
   , ( [t| StatementList |] ,"TheStatementList")
   , ( [t| Exp |] ,"TheExp")
   , ( [t| Ident |] ,"TheIdent")
   , ( [t| Integer_Literal |] ,"TheInteger_Literal")
   , ( [t| ExpList |] ,"TheExpList")
   , ( [t| ExpRest |] ,"TheExpRest")
   , ( [t| QualifiedIdent |] ,"TheQualifiedIdent")
   , ( [t| ImportDecl |] ,"TheImportDecl")
   , ( [t| ImportDeclList |] ,"TheImportDeclList")
   , ( [t| PackageDecl |] ,"ThePackageDecl")
   , ( [t| Modifier |] ,"TheModifier")
   , ( [t| Modifiers |] ,"TheModifiers")
   , ( [t| VarDecl |] ,"TheVarDecl")
   , ( [t| ForParam |] ,"TheForParam")
   ]
   "JAVA"
   (\t c -> "CONSTRUCTOR_" ++ t ++ "_" ++ c)
   "JAVAPF"
   True
   Balanced
  )
 )

type instance PF JAVA = JAVAPF
